function defaultLogin(){
    if(uni.getStorageSync('access-token') != '') {
        return true;
    }
    console.info('is_logout = ' + uni.getStorageSync('is_logout'))
    if(uni.getStorageSync('is_logout') == true) {
        return true;
    }
    return new Promise((resolve, reject) => {
        uni.login({
            success: async(res) => {
                uni.request({
                    // url: 'http://hdsq.com/api/v2/site/wechat-open', 
                    url: 'https://hdsq.aoorange.cn/api/v2/site/wechat-open', 
                    data: {
                        appkey: uni.getStorageSync('appkey'),
                        group: uni.getStorageSync('group'),
                        wechatCode: res.code,
                    },
                    success: (res) => { 
                        if(res.data.code == 200){
                            uni.setStorageSync('access-token', res.data.data.access_token);
                            uni.setStorageSync('parentKey', res.data.data.parentKey);
                            // resolve(true);
                        }
                        resolve(true);
                    }
                });
				
            },
        });
    });
}

export {
    defaultLogin
};